/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package controller;

/**
 *
 * @author Reza
 */
public class SelectDrink extends StateC {       //SelectDrink er en subclass som extender fra StateC
    
    
    //Construktor
    protected SelectDrink(){
        displayStr(" Please select Drink \nChoose between Tea, Coffee and Chocolate ");
    }
    
    @Override
    protected void handle(String event, int data){
        if(event.equals("Tea") || event.equals("tea")){                 // så er der ikke forskelle mellem stor og små bogstaver
                                                                        //The equals method compares two strings to see whether they have the same characters in them.
                                                                        // evnt Er Input
                                                                        // equals og ikke == fordi d er en String
            money = 5;
            brew = 5000;
            System.out.println("Price for the Tea is: " + money);
            changeState(new InsertMoney());
                
        }
        else if(event.equals("Chocolate") || event.equals("chocolate")){ 
            money = 8;
            brew = 5000;
            System.out.println("Price for the Chocolate is: " + money);
            changeState(new InsertMoney());
        }
        else if (event.equals("Coffee") || event.equals("coffee")){ 
            money = 6;
            brew = 5000;
            System.out.println("Price for the Coffee is: " + money);
            changeState(new InsertMoney());
        }
        else{
            
            System.out.println("Du har tastet forkert...");
           changeState(new SelectDrink());
                   
        }
    }
    

}
